package com.potenza.edu.media.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OSSConfig {


    @Value("${oss.endpoint}")
    private String endpoint;//电脑
    @Value("${oss.accessKeyId}")
    private String accessKeyId;//电脑用户名
    @Value("${oss.accessKeySecret}")
    private String accessKeySecret;//电脑密码

    @Bean
    public OSS OSSClient(){
        // 创建OSSClient实例。
        OSS ossClient = new OSSClientBuilder()
                .build(endpoint, accessKeyId, accessKeySecret);

        return ossClient;
    }
}
